This is not used by any test, nor is it packaged. Though let's just port
it over to py3 to certify our codebase completely py2-free. I've
manually checked that the script is still functional.
Closes: #1546
Approved by: cgwalters
-#!/usr/bin/python
+#!/usr/bin/python3
#
# Copyright (C) 2015 Red Hat
#
import os
import sys
+import functools
if len(sys.argv) == 1:
loaderpath = '/boot/loader/entries'
if o.startswith('ostree='):
return o[8:]
raise ValueError('ostree= not found')
-
+
entries = []
grub2_entries = []
v = line[s+1:]
entry[k] = v
entries.append(entry)
- entries.sort(compare_entries_descending)
+ entries.sort(key=functools.cmp_to_key(compare_entries_descending))
# Parse GRUB2 config
with open(grub2path) as f:
for line in f:
if line.startswith('### BEGIN /etc/grub.d/15_ostree ###'):
in_ostree_config = True
- elif line.startswith('### END /etc/grub.d/15_ostree ###'):
+ elif line.startswith('### END /etc/grub.d/15_ostree ###'):
in_ostree_config = False
if grub2_entry is not None:
grub2_entries.append(grub2_entry)